home *** CD-ROM | disk | FTP | other *** search
/ Developer Helper 1: Phil & Dave's Excellent CD / Excellent CD HFS.raw / Utilities / ResEdit / Examples / PExamples / Source / RSSC.a < prev   
Text File  |  2022-08-05  |  3KB  |  93 lines

  1. ;
  2. ; COPYRIGHT (C) 1984-1989 Apple Computer,Inc.
  3. ; All rights reserved
  4.  
  5. ; This is the standard interface for a Resource Standard Code segment for use
  6. ; by the resource editor.  The main resource editor will dispatch to this code
  7. ; when the user opens the respective type for editing.  Dispatches will also
  8. ; occur with menu commands and events for this window.  This code should be
  9. ; included in the resource editor file under type RSSC with any unique ID.  It's
  10. ; resource name should consist of the type it's willing to edit or 'ALL' if it
  11. ; can edit all types of resources. {This comment is too old...}
  12.  
  13. ; Each code segment MUST have a window and its kind MUST be the ID of the code and
  14. ; the refcon usually contains the handle to the instance of the object who's
  15. ; owned by the code.  On activate/deactivate events, the code can put up and
  16. ; remove any menus if desired.
  17.  
  18. ; The standard routines are:
  19.  
  20.  
  21. ;        EditBirth( thing:Handle; parent: ParentHandle );
  22.  
  23. ;        PickBirth( t: ResType; parent: ParentHandle );
  24.  
  25. ;        DoMenu( menu, item: INTEGER; object: Handle );
  26.  
  27. ;        DoEvent( VAR evt: EvtRecord; object: Handle );
  28.  
  29.  
  30.  
  31.             BLANKS      ON
  32.             STRING      ASIS
  33.  
  34.         INCLUDE    'Traps.a'
  35.  
  36. StdRSSC      MAIN
  37.  
  38. ; Implemented in pascal for now...
  39.  
  40.             IMPORT      PickBirth
  41.             IMPORT      EditBirth
  42.             IMPORT      DoEvent
  43.             IMPORT      DoMenu
  44.             IMPORT      DoInfoUpdate
  45.             EXPORT      ResEdID
  46.  
  47. StdHeader
  48.             DC.L        ('RSSC')
  49.  
  50.             DC.W        JEditBirth-StdHeader
  51.             DC.W        JPickBirth-StdHeader
  52.             DC.W        JDoEvent-StdHeader
  53.             DC.W        JDoMenu-StdHeader
  54.             DC.W        JDoInfoUpdate-StdHeader
  55.             DC.W        0
  56.             DC.W        0
  57.             DC.W        0
  58.             DC.W        0
  59. JEditBirth
  60. ; someday search for a window which satisfies this request
  61.             JMP            EditBirth
  62. JPickBirth
  63.             JMP            PickBirth
  64. JDoEvent
  65.             JMP            DoEvent
  66. JDoMenu
  67.             JMP            DoMenu
  68. JDoInfoUpdate
  69.             JMP            DoInfoUpdate
  70.  
  71.  
  72. ; Gets Res ID of self and returns it
  73. ;        FUNCTION ResEdID: INTEGER;
  74.  
  75. ResEdID
  76.             LINK        A6,#-256
  77.  
  78.             LEA            StdHeader,A0
  79.             _RecoverHandle
  80.  
  81.             MOVE.L      A0,-(SP)            ; pass handle
  82.             PEA            8(A6)                ; function result
  83.             PEA            -256(A6)            ; ignore type
  84.             MOVE.L      (SP),-(SP)            ; ignore name
  85.             _GetResInfo
  86.  
  87.             UNLK        A6
  88.  
  89.             RTS
  90.  
  91.             END 
  92.  
  93.